<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>wind management</title>
<link href="/statics/css/admin_style.css" rel="stylesheet" />
<script src="/statics/js/jquery.js"></script>
<script src="/statics/js/supe.js"></script>
</head>
<body>
<div class="wrap">

<ul id="treeDemo" class="ztree"></ul>
</div>

</body>
<SCRIPT type="text/javascript">
    <!--
    var setting = {
        data: {
            simpleData: {
                enable: true,
                idKey: "id",
                pIdKey: "pid"
            }
        },
        view:{
            showIcon: true,
        }
    };

    var zNodes =[
        <?php
            foreach($cartree->data as $id => $data){
                if(isset($cartree->maps[$id]))
                    $string = '{id:%d, pid:%d, name:"%s"},';
                else
                    $string = '{id:%d, pid:%d, name:"%s", url:"?pid=%1$d", target:"_top"},';

                printf($string, $data['ccid'], $data['pid'], h($data['title']));
                echo "\n";
            }
        ?>
    ];

    //$(document).ready(function(){
    //    $.fn.zTree.init($("#treeDemo"), setting, zNodes);
    //});

    Supe.use('zTree', function(){
        $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        //$("#treeDemo").zTree(setting, zNodes);
    });
    //-->
</SCRIPT>
</html>